@import "frappe/public/scss/website/variables";

.edit-page-head {
	margin-top: 1rem;
	display: flex;
	justify-content: space-between;
	.edit-title {
		width: 100%;
		margin-right: 20px;
		align-items: flex-start;
		height: 33px;
		i {
			padding: 0.35rem 0.5rem 0.5rem 0.5rem;
		}
	}

	.draft-wiki-page {
		margin-right: 20px;
		max-height: 2.2rem;
		min-width: 130px;
	}

	.submit-wiki-page {
		max-height: 2.2rem;
		min-width: 130px;
	}
}

.nav-tabs {
	padding-bottom: 0;

	.nav-item {
		margin: 0 2rem 0 0;

		.nav-link {
			padding: 0.5rem 0;
			margin-right: 0;
			font-weight: 500;
		}
	}
}

.edit-form {
	margin-top: 0.8rem !important;
}

.form-column {
	padding: 0;

	.frappe-control .ql-editor {
		background-color: white;
	}
}

.form-control {
	background-color: white;
	border: solid $gray-300 1px;
}

.form-control:focus {
	background-color: white;
	border: solid $gray-300 1px;
}

.ace-editor-target {
	background-color: white;
}

.ace-tm .ace_gutter {
	background-color: white;
	border-right: solid rgb(244, 245, 246) 1px;
}

// edit page

.attachment-controls {
	cursor: pointer;
	max-height: 28px;
	display: flex;
	justify-content: flex-end;

	.show-attachments {
		padding: 8px;
		color: $primary;
	}
}

div[data-fieldname="type"] {
	.form-group {
		margin-bottom: 0;
	}
	.clearfix {
		display: none;
	}
}

.popover {
	max-width: 400px;
	td {
		border-top: 0;
	}
}

.edit-title {
	display: flex;
	align-items: center;

	span {
		margin-bottom: 0;
	}

	i {
		cursor: pointer;
		padding: 0.5rem;
	}
}

.wiki-write select {
	height: calc(1.5em + 0.75rem + 2px);
}

$font-sizes-desktop: (
	"sm": 0.75rem,
	"base": 1rem,
	"lg": 1.125rem,
	"xl": 1.41rem,
	"2xl": 1.6rem,
	"3xl": 2rem,
);

$font-sizes-mobile: (
	"sm": 0.75rem,
	"base": 1rem,
	"lg": 1.125rem,
	"xl": 1.25rem,
	"2xl": 1.5rem,
	"3xl": 1.75rem,
);

.ql-snow .ql-editor {
	font-size: map-get($font-sizes-desktop, "base");
	color: $gray-700;
	line-height: 1.7;
	letter-spacing: -0.011em;

	> * + * {
		margin-top: 0.75rem !important;
		margin-bottom: 0 !important;
	}

	> :first-child {
		margin-top: 0 !important;
	}

	> :last-child {
		margin-bottom: 0 !important;
	}

	ul,
	ol {
		padding-left: 2rem;
	}

	ul {
		list-style-type: disc;
	}

	ol {
		list-style: decimal;
	}

	li {
		padding-top: 1px;
		padding-bottom: 1px;
	}

	li > ul,
	li > ol {
		padding-left: 1.5rem;
	}

	ul > li:first-child {
		margin-top: 3px !important;
	}

	ul > * + *,
	ol > * + * {
		margin-top: 2px !important;
	}

	> blockquote {
		padding: 0.75rem 1rem 0.75rem 1.25rem;
		font-size: $font-size-sm;
		font-weight: 500;
		border: 1px solid $gray-200;
		border-left: 3px solid $yellow;
		border-top-left-radius: 0.1rem;
		border-bottom-left-radius: 0.1rem;
		border-top-right-radius: 0.375rem;
		border-bottom-right-radius: 0.375rem;
		margin: 1.5rem 0 !important;
	}

	blockquote p:last-child {
		margin-bottom: 0 !important;
	}

	b,
	strong {
		color: $gray-800;
		font-weight: 600;
	}

	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		color: $gray-900;
	}

	h2,
	h3,
	h4,
	h5,
	h6 {
		font-weight: 600;
	}

	h1 {
		font-size: map-get($font-sizes-mobile, "3xl");
		line-height: 1.5;
		letter-spacing: -0.021em;
		font-weight: 700;

		@include media-breakpoint-up(md) {
			font-size: map-get($font-sizes-desktop, "3xl");
			letter-spacing: -0.024em;
		}

		// for byline
		& + p {
			margin-top: 1.5rem !important;
			font-size: map-get($font-sizes-mobile, "xl");
			letter-spacing: -0.014em;
			line-height: 1.4;

			@include media-breakpoint-up(md) {
				font-size: map-get($font-sizes-desktop, "xl");
				letter-spacing: -0.0175em;
			}
		}
	}

	h2 {
		font-size: map-get($font-sizes-mobile, "2xl");
		line-height: 1.56;
		letter-spacing: -0.015em;
		margin-top: 4rem !important;

		@include media-breakpoint-up(md) {
			font-size: map-get($font-sizes-desktop, "2xl");
			letter-spacing: -0.0195em;
		}
	}

	h3 {
		font-size: map-get($font-sizes-mobile, "xl");
		line-height: 1.56;
		letter-spacing: -0.014em;
		margin-top: 2.25rem !important;

		@include media-breakpoint-up(md) {
			font-size: map-get($font-sizes-desktop, "xl");
			letter-spacing: -0.0175em;
		}
	}

	h4 {
		font-size: map-get($font-sizes-mobile, "lg");
		line-height: 1.56;
		letter-spacing: -0.014em;
		margin-top: 2.5rem !important;
	}

	h5 {
		font-size: map-get($font-sizes-mobile, "base");
		line-height: 1.5;
		letter-spacing: -0.011em;
		font-weight: 600;
		margin-top: 2rem !important;
	}

	h6 {
		font-size: map-get($font-sizes-mobile, "sm");
		line-height: 1.35;
		font-weight: 600;
		text-transform: uppercase;
		margin-top: 1.5rem !important;
	}

	tr > td,
	tr > th {
		font-size: $font-size-sm;
		padding: 0.5rem;
	}

	th:empty {
		display: none;
	}

	.screenshot {
		border: 1px solid $gray-400;
		border-radius: 0.375rem;
		margin-top: 0.5rem !important;
	}

	.screenshot + em {
		text-align: center;
		display: block;
		margin-top: 0.5rem !important;
		margin-bottom: 2rem !important;
	}

	code:not(.hljs) {
		padding: 0 0.25rem;
		background: $light;
		border-radius: 0.125rem;
	}

	table {
		border-color: $gray-200;
	}

	table thead {
		background-color: $light;
	}

	.table-bordered,
	.table-bordered th,
	.table-bordered td {
		border-left: none;
		border-right: none;
		border-color: $gray-200;
	}

	.table-bordered thead th,
	.table-bordered thead td {
		border-bottom-width: 1px;
	}
}

.modal .modal-header {
	border-bottom: unset;
}

.modal .modal-footer {
	border-top: unset;
}

// button
.btn:hover {
	color: #000;
	background-color: #f9fafb;
	border-color: #f9fafb;
}

.btn.btn-primary:hover {
	color: #fff;
	background-color: #0b5ed7;
	border-color: #0a58ca;
}

.show-attachments:hover {
	color: #0a58ca;
}

@media (min-width: 992px) {
	.doc-main .page-content-wrapper {
		padding: 2rem;
	}
}
